package com.realdtech.wechat.task.Service;


import com.realdtech.wechat.task.model.UserApply;

import java.util.Date;
import java.util.List;

/**
 * Created by Administrator on 2017/9/20.
 */
public class UserApplyService {
    private static final UserApply dao=new UserApply().dao();

    /**
     * 保存信息
     * @param loanName 名字
     * @param loanTel   手机号
     * @param loanMoney 钱
     * @param image_name 渠道名字
     * @param Deadline  贷款期限
     * @param Product   产品类型
     * @param Limit     还款额度
     * @param Repayment 还款方式
     * @param Interest  贷款利率
     */
    public void add(String loanName,String loanTel,String loanMoney,String image_name,String Deadline,String Product,String Limit,String Repayment,String Interest){
        UserApply UA=new UserApply();
        UA.setUserName(loanName);
        UA.setPhone(loanTel);
        UA.setMoney(loanMoney);
        UA.setImageName(image_name);
        UA.setDeadline(Deadline);
        UA.setProduct(Product);
        UA.setLimit(Limit);
        UA.setRepayment(Repayment);
        UA.setInterest(Interest);
        UA.setDate(new Date());

        UA.save();
    }

    /**
     * 查询快速申请表
     * @return
     */
    public List<UserApply> find(){
        return dao.find("SELECT * from user_apply  order by id desc");
    }



}
